1. Field of the Invention
The present invention relates to video processing; more specifically, the present invention relates to processing a picture frame with fewer memory accesses.
2. Descriptions of the Related Art
Films commonly appear grainy in images and video as a result of the physical granularity of photographic emulsions. The film grain makes the images and videos look more vivid and creates an artistic effect. Without film grain, the objects and people in the images and videos look plastic.
Although film grain provides the aforementioned advantages, it is hard to preserve the film grain when an image/video is encoded or compressed. The reason is that film grain is a mid-frequency noise-like pattern, which comprises high entropy and is hard to encode in only a few bits.
A solution to the aforementioned problem is to remove, model, and synthesize film grains during encoding/compression and decoding/decompression, which is also referred to as film grain technology. More specifically, film grain on an image or a video frame is removed during encoding/compression to achieve a good compression rate. When a decoder receives a bitstream, it models the film grain, retrieves supplemental enhancement information, and synthesizes the bitstream with the supplemental enhancement information to derive the resultant image with the film grain.
FIG. 1 illustrates a video decoder 1 with film grain technology. The video decoder 1 comprises a decoder 11, an averaging unit 13, a static random access memory (SRAM) 14, a searching unit 15, a pseudo random number generator (PRNG) 16, a database (DB) retrieving unit 17, an enhancing apparatus 18, and a dynamic random access memory (DRAM) 19.
Please refer to FIG. 1B, which illustrates the concept of a video frame 10. A video clip is usually encoded as a plurality of frames 10. Each of the frames 10 is encoded as a plurality of 16×16 macroblocks (MBs). Each of the macroblocks 10a is encoded as four luminance blocks 10b and two chrominance blocks 10c. The dimension of each block is 8×8 in pixels.
The decoder 11 decodes a received bitstream 101 to derive a decoded macroblock, i.e. four luminance blocks and two chrominance blocks. Since a video frame is block-based encoded/decoded, there are boundaries between blocks. In order to have pleasantly decoded video frames, the decoder 11 further deblocks the decoded macroblock to remove the boundary effect. After deblocking, the deblocked macroblock 103 stores in the DRAM 19 for later reference. The deblocked macroblocks are retrieved from the DRAM 19 for conducting a next video/image processing stage such as film grain processing as shown in FIG. 1A.
For each of the six blocks, the averaging unit 13 averages its pixel values and derives an averaged value 104. The searching unit 15 then uses the averaged value 104 to search the DRAM 19 for supplemental enhancement information (SEI) 105. Meantime, the PRNG 16 generates a random number 106 according to the decoded macroblock 102. The database retrieving unit 17 then retrieves corresponding detailed information 107 according to the SEI 105 and the random number 106. Finally, the enhancing apparatus 18 enhances the deblocked macroblock 103 using the corresponding detailed information 107 to produce an enhanced macroblock 108. The enhanced macroblock is then displayed on a screen or stored in the DRAM 19.
The drawback of the aforementioned arrangement is that it requires a large amount of DRAM 19 access and requires large DRAMs to store the deblocked macroblock 103 for implementing film grain technology. As a result, this drawback places a lot of burden on the DRAM 19 and degrades the decoding efficiency.